package com.edooteach.api.servcice.trading.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.demo2do.core.persistence.GenericDaoSupport;
import com.edoomath.entity.trade.PaymentRequest;
import com.edooteach.api.servcice.trading.PaymentRequestService;

/**
 * 
 * @author mohanlan
 *
 */
@Service("paymentRequestService")
public class PaymentRequestServiceImpl implements PaymentRequestService {
	
	@Autowired
    private GenericDaoSupport genericDaoSupport;
	
	/*
	 * (non-Javadoc)
	 * @see com.edoomath.api.servcice.PaymentRequestService#load(java.lang.String)
	 */
	public PaymentRequest load(String requestCode) {
        return genericDaoSupport.searchForObject("FROM PaymentRequest WHERE code = :code AND disabled = false AND payCode IS NULL AND payTime IS NULL", "code", requestCode, PaymentRequest.class);
    }
	
}
